package edu.chds.ui
{
	import fl.controls.TextArea;
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFormat;

	public class TimelineNode extends MovieClip
	{
		public var title:TextArea;
		public var type:TextArea;
		public var date:TextField;
		
		private var _year:Number;
		private var _month:Number;
		private var _xpos:Number;
		private var _active:Boolean;
		private var txtFormat:TextFormat = new TextFormat();
		 
		public function TimelineNode() {
			init()
		}
		private function init():void {
						
			title = taTitle;
			type = taType;
			date = tfDate;
			title.editable = type.editable = false;
			
			formatText();
		}
		private function formatText():void {
			txtFormat.size = 10;
			txtFormat.color = 0x333333;
			
			title.setStyle("textFormat", txtFormat);
			type.setStyle("textFormat", txtFormat);
			
		}
		public function get year():Number {
			return _year;
		}
		public function set year(yearValue:Number):void {
			_year = yearValue;
			_xpos = _year;
		}
		public function get month():Number {
			return _month;
		}
		public function set month(monthValue:Number):void {
			_month = monthValue;
		}
		//Need to set year && month before you can access xpos
		public function get xpos():Number {
			return _xpos;
		}
		public function set xpos(yearMin:Number):void {
			_xpos -= yearMin;
			_xpos += _month;
		}
		public function get active():Boolean {
			return _active;
		}
		public function set active(act:Boolean):void {
			_active = act;
		}
	}
}